﻿#region 命名空间

using System.Web.Mvc;
using WinnerCMS.BLL;
using WinnerCMS.Common;
using WinnerCMS.Model;
using WinnerCMS.WebUI.Areas.Mobile.Models;

#endregion

namespace WinnerCMS.WebUI.Areas.Mobile.Controllers
{
    public class MobileController : Controller
    {
        public ActionResult Index()
        {
            var model = new IndexModel {TopCategories = CategoryManage.GetChildren(0)};
            ViewBag.Title = WebConfig.SiteName;

            return View(model);
        }

        public ActionResult Category(int categoryId, int pageNo = 1)
        {
            var model = new CategoryModel
            {
                TopCategories = CategoryManage.GetChildren(0)
            };
            ViewBag.Title = WebConfig.SiteName;

            var pp = new PagingParam {PageNo = pageNo, PageSize = 10};
            var cores = new CoreManage().CategoryPageBindList(categoryId, string.Empty, pp);
            model.Cores = cores;
            model.PagingParam = pp;

            return View(model);
        }
    }
}